<?php
/**
 * 主导航菜单组件
 */
namespace app\commands\front;

use app\modules\cn\models\ParentUrl;
use yii\base\Widget;
use yii;

class FootWidget extends Widget
{
    public $category;
    public $banner;
    public $code;

    /**
     * 定义函数
     * */
    public function init()
    {//这个可以取侧边栏数
    }

    /**
     * 运行覆盖程序
     * */
    public function run()
    {
 
        $parenturlone=  ParentUrl :: find()->where("type =1")->orderby("sort,id")->asarray()->all();
        $parenturltwo=  ParentUrl :: find()->where("type =2")->orderby("sort,id")->asarray()->all();
        $parenturlthree=  ParentUrl :: find()->where("type =3")->orderby("sort,id")->asarray()->all();
        //微信号及二维码
        $wx['chat'] = Yii::$app->params['chat_wx'][6][date("w")];
        $wx['image'] = Yii::$app->params['chat_wx']['image6'][date("w")];
        // var_dump($parenturl);die;
        return $this->render('foot',['parenturlone'=>$parenturlone,'parenturltwo'=>$parenturltwo,'parenturlthree'=>$parenturlthree,'wx'=>$wx]);
    }
}

?>

